/*     */ package com.zimbra.cs.imap;
/*     */ 
/*     */ import com.zimbra.common.localconfig.KnownKey;
/*     */ import com.zimbra.common.localconfig.LC;
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import com.zimbra.cs.account.Config;
/*     */ import com.zimbra.cs.account.Provisioning;
/*     */ import com.zimbra.cs.account.Server;
/*     */ import com.zimbra.cs.server.ServerConfig;
/*     */ import com.zimbra.cs.util.BuildInfo;
/*     */ import java.util.Arrays;
/*     */ import java.util.List;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class ImapConfig
/*     */   extends ServerConfig
/*     */ {
/*     */   private static final String PROTOCOL = "IMAP4rev1";
/*     */   private static final int DEFAULT_MAX_MESSAGE_SIZE = 104857600;
/*     */   
/*     */   public ImapConfig(boolean ssl)
/*     */   {
/*  38 */     super("IMAP4rev1", ssl);
/*     */   }
/*     */   
/*     */   public String getServerName()
/*     */   {
/*  43 */     return getAttr("zimbraImapAdvertisedName", LC.zimbra_server_hostname.value());
/*     */   }
/*     */   
/*     */   public String getServerVersion()
/*     */   {
/*  48 */     return getBooleanAttr("zimbraImapExposeVersionOnBanner", false) ? BuildInfo.VERSION : null;
/*     */   }
/*     */   
/*     */   public String getBindAddress()
/*     */   {
/*  53 */     return getAttr(isSslEnabled() ? "zimbraImapSSLBindAddress" : "zimbraImapBindAddress", null);
/*     */   }
/*     */   
/*     */   public int getBindPort()
/*     */   {
/*  58 */     return isSslEnabled() ? getIntAttr("zimbraImapSSLBindPort", 993) : getIntAttr("zimbraImapBindPort", 143);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public int getWriteTimeout()
/*     */   {
/*  65 */     return LC.imap_write_timeout.intValue();
/*     */   }
/*     */   
/*     */   public int getWriteChunkSize()
/*     */   {
/*  70 */     return LC.imap_write_chunk_size.intValue();
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public int getMaxIdleTime()
/*     */   {
/*  80 */     return LC.imap_max_idle_time.intValue();
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public int getAuthenticatedMaxIdleTime()
/*     */   {
/*  89 */     return LC.imap_authenticated_max_idle_time.intValue();
/*     */   }
/*     */   
/*     */   public int getMaxThreads()
/*     */   {
/*  94 */     return getIntAttr("zimbraImapNumThreads", super.getMaxThreads());
/*     */   }
/*     */   
/*     */   public int getMaxConnections()
/*     */   {
/*  99 */     return getIntAttr("zimbraImapMaxConnections", super.getMaxConnections());
/*     */   }
/*     */   
/*     */   public Log getLog()
/*     */   {
/* 104 */     return ZimbraLog.imap;
/*     */   }
/*     */   
/*     */   public String getConnectionRejected()
/*     */   {
/* 109 */     return "* BYE " + getDescription() + " closing connection; service busy";
/*     */   }
/*     */   
/*     */   public int getShutdownTimeout()
/*     */   {
/* 114 */     return getIntAttr("zimbraImapShutdownGraceSeconds", super.getShutdownTimeout());
/*     */   }
/*     */   
/*     */   public int getThreadKeepAliveTime()
/*     */   {
/* 119 */     return LC.imap_thread_keep_alive_time.intValue();
/*     */   }
/*     */   
/*     */   public boolean isCleartextLoginEnabled() {
/* 123 */     return getBooleanAttr("zimbraImapCleartextLoginEnabled", false);
/*     */   }
/*     */   
/*     */   public boolean isSaslGssapiEnabled() {
/* 127 */     return getBooleanAttr("zimbraImapSaslGssapiEnabled", false);
/*     */   }
/*     */   
/*     */   public boolean isCapabilityDisabled(String name) {
/* 131 */     String key = isSslEnabled() ? "zimbraImapSSLDisabledCapability" : "zimbraImapDisabledCapability";
/*     */     try {
/* 133 */       return Arrays.asList(getLocalServer().getMultiAttr(key)).contains(name);
/*     */     } catch (ServiceException e) {
/* 135 */       getLog().warn("Unable to get server attribute: " + key, e); }
/* 136 */     return false;
/*     */   }
/*     */   
/*     */   public int getMaxRequestSize()
/*     */   {
/* 141 */     return getIntAttr("zimbraImapMaxRequestSize", LC.imap_max_request_size.intValue());
/*     */   }
/*     */   
/*     */ 
/*     */   public long getMaxMessageSize()
/*     */     throws ServiceException
/*     */   {
/* 148 */     return Provisioning.getInstance().getConfig().getLongAttr("zimbraMtaMaxMessageSize", 104857600L);
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/imap/ImapConfig.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */